get record of last 24 hours in laravel

226

get record of last 24 hours in laravel -

Method # 1
 Mood::where('created_at', '>=', Carbon::now()->subDay())->get();

Method # 2
 Mood::whereBetween('created_at', [now()->subMinutes(1440), now()])->get();

Comments

Submit
0 Comments